package Maze;

import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics;

public class MazeGrid extends Canvas
{
  private boolean mark;
  private boolean isVisited;
  private boolean isPersonCome;
  private boolean isStart;
  private boolean isEnd;

  public MazeGrid()
  {
    setBackground(Color.gray);
    setSize(25, 25);
  }

  public MazeGrid(boolean mark, int width, int height) {
    this.mark = mark;
    setSize(width, height);
    if (mark)
      setBackground(Color.white);
    else
      setBackground(Color.green);
  }

  public boolean isMark()
  {
    return this.mark;
  }

  public void setMark(boolean mark) {
    this.mark = mark;
  }

    @Override
  public void paint(Graphics g) {
    if (this.mark) {
      if ((this.isStart) || (this.isEnd))
        setBackground(Color.BLACK);
      else
        setBackground(Color.white);
    }
    else setBackground(Color.green);

    if (this.isPersonCome) {
      g.setColor(Color.blue);
      g.fillOval(2, 2, 15, 15);
    }
  }

  public boolean isVisited()
  {
    return this.isVisited;
  }

  public void setVisited(boolean isVisited) {
    this.isVisited = isVisited;
  }

  public boolean isPersonCome() {
    return this.isPersonCome;
  }

  public void setPersonCome(boolean isPersonCome) {
    this.isPersonCome = isPersonCome;
  }

  public boolean isStart() {
    return this.isStart;
  }

  public void setStart(boolean isStart) {
    this.isStart = isStart;
  }

  public boolean isEnd() {
    return this.isEnd;
  }

  public void setEnd(boolean isEnd) {
    this.isEnd = isEnd;
  }
}